//
//  BaseHttpService.h
//  Unity-iPhone
//
//  Created by 宁校航 on 15/11/10.
//
//

#import <Foundation/Foundation.h>
#import "WellConfig.h"
#import "MainInterface.h"



typedef void (^BaseHttpServiceBlock)(NSMutableDictionary *functionDic);

//@protocol BaseHttpServiceDelegate <NSObject>
//
//@required
//-(void)dealFinishedWithNum:(NSInteger)status AndSelf:(BaseHttpService *)service;
//
//@end

@interface BaseHttpService : NSObject <UIAlertViewDelegate>
{
    @public
    id responseData;
    NSString *interfaceName;
}

//@property (nonatomic,weak)id <BaseHttpServiceDelegate>httpDelegate;
@property (nonatomic)BaseHttpServiceBlock baseHttpServiceBlock;

/**
 获取调用服务的接口名称
 */
-(NSString *)getServiceName;

/**
 向服务器请求数据
 str:传入数据的json字符串
 */
-(void)requestToService:(NSDictionary *)json;

/**
 服务器处理失败后，去本地进行查找处理
 send:传入数据的json字符串
 */
-(NSString *)dealFailed:(NSDictionary *)send;

/**
 请求失败
 */
-(void)failedMessage:(NSDictionary *)send;

/**
 获取服务器地址
 */
-(NSString *)getUrl;

/**
 请求成功后的数据处理，由子类实现
 */
-(void)requestSuccessData:(id)data AndRequest:(NSDictionary *)request;

@end
